package com.zx.role.controller;

import com.zx.role.domain.City;
import com.zx.role.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("city")
public class CityController {

    @Autowired
    CityService cityService;


    /**
     * 获取省市区列表
     */
    @GetMapping("getCityList")
    public Map<String,Object> getCityList(Integer id){
        Map<String,Object> map = new HashMap<>();
        List<City> list = cityService.getAllList(id);
        map.put("list",list);
        return map;
    }
}
